import {HEADER_DATA} from '../actions/actionType.js'

const initialState = {
  items: []
}

const getCategory = (state, action) => {
  let items = action.obj.data.primary_filter
  return {...state, items}
}

const categoryReducer = (state = initialState, action) => {
  switch(action.type){
    case HEADER_DATA:
      return getCategory(state, action)
    default:
      return state
  }
}

export default categoryReducer